;
(function() {
	var skill = {
		save: function() {
			db.update(config.dbname.express, this._id, this);
		},
		destroy: function() {
			db.remove(config.dbname.express, this._id);
		},
		setInfo: function(info) {
			info.name = String(info.name || "").trim();
			if (!info.name) {
				throwCusError("运费模板名不可放空");
			}
			//运营商
			info.express_com = String(info.express_com || "").trim();
			if (!info.express_com) {
				throwCusError("物流公司不可放空");
			}
			//邮费价格
			info.express_price = parseFloat(info.express_price) || 0;

			this.name = info.name;
			this.express_com = info.express_com;
			this.express_price = info.express_price;

			//局部配送选取
			//对区域进行一定排序，细=》广
			this.districts = [];
			if (Array.isArray(info.districts)) {
				// info.districts.
			}

			/*保存*/
			this.save();
		}
	}
	module.exports = skill;

	var db = require("../db/index");
	var GoodsCon = require("../goods/_con");
	var UserCon = require("../../core/user/_con");
	var BusCon = require("../../core/bus/_con");
	var AchCon = require("../ach/_con");
	var ClassifyCon = require("../bus.classify/_con");
	var TagCon = require("../bus.tag/_con");
	var LeagueCon = require("../league/_con");
	var BuffCon = require("../buff/_con");
	var BusUserBindCon = require("../bus_user_bind/_con");
	var BusGuideCon = require("../bus.guide/_con");
	var BusSpaceCon = require("../bus.space/_con");
	var CommentCon = require("../comment/_con");
	var config = require("../_include/config");
	var data_cut = require("../_include/data_cut");
	var helper = require("../_include/helper");
	var md5 = require("../_include/md5");
	var $Object = require("../_include/$.Object");
	var $Array = require("../_include/$.Array");
}());